home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
TARCHIV.ZIP
/
LOGFILE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-01-27
|
811b
|
54 lines
Unit Logfile;
Interface
Uses Toolbox;
Type
PLogfile = ^TLogfile;
TLogfile = Object
DoLog : Boolean;
Log : Text;
Constructor Init (Logfilename : String);
Procedure Writelog (Message : String);
Destructor Done;
End;
Implementation
Constructor TLogfile.Init (Logfilename : String);
Begin
DoLog := (Length(Logfilename)>0);
If DoLog Then Begin
{$I-}
Assign (Log,LogFilename);
If FileExists (LogFilename) Then
Append (Log)
Else
Rewrite (Log);
{$I+}
End;
End;
Procedure TLogfile.Writelog (Message : String);
Begin
If DoLog Then Begin
{$I-}
Writeln (Log,Message);
{$I+}
End;
Writeln (Message);
End;
Destructor TLogfile.Done;
Begin
{$I+}
Close (Log);
{$I+}
End;
Begin
End.